#include "main.h"

using namespace std;

int main(int argc, char** argv)
{
    bool help=false;
    if(argc==1){
        helpProcess();
    }
    else if( strcmp(argv[1],"--vectors") ==0){
        buildEigenvectorsProcess("./imagesDB", "eigenvectors.mat");
    }
    else if( strcmp(argv[1],"--picture") ==0){
        if(argc==3){
            faceDetectionProcess(argv[2]);
        }else{help=true;}
    }
    else if( strcmp(argv[1],"--tag") ==0){
        if(argc==6){
            tag(argv[2], atoi(argv[3]), atoi(argv[4]), atoi(argv[5]));
        }else{help=true;}
    }
    else{
        help=true;
    }

    if(help)
    {
        cout<<"Mauvaise utilisation"<<endl<<endl;
        helpProcess();
    }

    return EXIT_SUCCESS;
}

void helpProcess()
{
    cout << "Options : " << endl;
    cout << "\t-- vectors" << endl;
    cout << "\t\tContruit la base de l'espace reduit dans lequel " << endl;
    cout << "\t\tles images de visage serons projetees." << endl;
    cout << "\t--picture picture" << endl;
    cout << "\t\tDetection et reconnaissance des visages presents" << endl;
    cout << "\t\tdans une image." << endl;
    cout << "\t--tag picture id x y" << endl;
    cout << "\t\tEnregistre le marquage manuel d'un visage." << endl;
}
